package xxx.common.enums;

/**
 * 错误码枚举<br/>
 * 系统错误码：[1,1000)<br/>
 * 业务错误码：[1001,5000)<br/>
 *
 * @author yuanchengman
 * @date 2021-01-14
 */
public enum CodeEnum implements CommonEnum {
    // 系统错误码
    /**
     * 参数错误
     */
    SUCCESS(1, "成功"),
    FAIL(2, "失败"),
    SYSTEM_PARAM_ERROR(3, "参数错误"),

    // 业务错误码

    BIZ_STRATEGY_EMPTY(1001, "XXX不存在");

    private final int code;
    private final String desc;

    CodeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getDesc() {
        return desc;
    }
}
